<template>
  <vue-particles
    id="tsparticles"
    :options="particleOptions"
  />
</template>

<script setup>
const  particleOptions = {
  fullScreen: {
    enable: true,
    zIndex: 1
  },
  fpsLimit: 60,
  interactivity: {
    events: {
      onClick: {
        enable: true,
        mode: 'push'
      },
      onHover: {
        enable: true,
        mode: 'repulse'
      },
      resize: true
    },
    modes: {
      push: {
        quantity: 4
      },
      repulse: {
        distance: 100,
        duration: 0.4
      }
    }
  },
  particles: {
    color: {
      value: [
        '#ff7c7c', // 红色
        '#ffb56b', // 橙色
        '#6bceff', // 蓝色
        '#a78bfa' // 紫色
      ]
    },
    links: {
      color: '#c0c0c0',
      distance: 150,
      enable: true,
      opacity: 0.3,
      width: 1
    },
    move: {
      direction: 'none',
      enable: true,
      outModes: {
        default: 'bounce'
      },
      random: true,
      speed: 2,
      straight: false
    },
    number: {
      density: {
        enable: true,
        area: 800
      },
      value: 80
    },
    opacity: {
      value: 0.5
    },
    shape: {
      type: 'circle'
    },
    size: {
      value: { min: 1, max: 5 }
    }
  },
  detectRetina: true,
  responsive: [
    {
      maxWidth: 768,
      options: {
        particles: {
          number: {
            value: 40
          }
        }
      }
    }
  ]
}
</script>
